package com.di.base.controller;

import com.di.base.service.StorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
@Slf4j
@RestController
@RequestMapping("/storage")
public class StorageController {
    @Resource
    StorageService storageService;
//  AT

    @GetMapping("/decrease")
    public String decrease(@RequestParam String productId, @RequestParam int count) {
        storageService.decreaseStock(productId, count);
        return "库存扣减成功";
    }

}
